#!/usr/bin/env python
import inkex, clean_style

class CleanStyle(inkex.Effect):
    """Remove style attributes when an attribute class exist"""
    def __init__(self):
        """ main stream"""
        inkex.Effect.__init__(self)
    
    def effect(self) :
        """select all nodes in the selection and  """
        for id, node in self.selected.iteritems():
            node = clean_style.cleanStyle(node)

# Create effect instance and apply it.
Effect = CleanStyle()
Effect.affect()